<!DOCTYPE html>
<html>
 
	<head>
		<meta charset="UTF-8">
 
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
 
		<style type="text/css">
			.id-w {
				width: 100%;
				height: 60px;
				border: 1px solid #ccc;
				display: flex;
				justify-content: space-around;
				align-items: center;
			}
		</style>
	</head>
 
	<body>
		<div id="main">
 
			<div id="" class="id-w">
				<div id="">昵称</div>
				<div id="">时间</div>
			</div>
 
		</div>
 
		<script type="text/javascript">
            // https://blog.csdn.net/qq_38026437/article/details/82893434
			var list = [{
					name: "小张",
					time: "12:22"
				},
				{
					name: "小刘",
					time: "12:22"
				},
				{
					name: "小李",
					time: "12:22"
				},
				{
					name: "小孙",
					time: "12:22"
				},
				{
					name: "小周",
					time: "12:22"
				},
			]
			var cent = document.getElementById("main");
 
			console.log(cent);
            var str = ''
			for(var i = 0; i < list.length; i++) {
				str += "<div id='' class='id-w'>" +
					"<div id=''> " + list[i].name + "</div>" +
					"<div id=''>" + list[i].time + "</div></div>";
			}
            cent.innerHTML = str
		</script>
	</body>
 
</html>